V2EX  ›  英汉词典
Enqueued related words: Factorial

Recursive Function

释义 Definition

递归函数:一种在定义或执行过程中调用自身的函数,通常需要包含基例(base case)来停止递归;否则可能导致无限递归与栈溢出。该术语在计算机科学与数学中都很常见(数学里也有“递归定义/递归可计算”的相关用法)。

发音 Pronunciation (IPA)

/rɪˈkɝːsɪv ˈfʌŋkʃən/

例句 Examples

I wrote a recursive function to calculate factorials.
我写了一个递归函数来计算阶乘。

Because each call creates a new stack frame, a recursive function can be elegant but may risk stack overflow if the base case is missing or too deep.
因为每次调用都会创建新的栈帧,递归函数可能很优雅,但如果缺少基例或递归层数过深,就可能有栈溢出的风险。

词源 Etymology

recursive 来自拉丁语 recurrere(“跑回去、返回”),引申为“反复回到同一过程/结构”;function 源自拉丁语 functio(“执行、履行”)。合在一起,recursive function 字面意思就是“会返回并再次执行自己的函数”,对应中文“递归函数”。

相关词 Related Words

文学与著作 Literary Works

  • Structure and Interpretation of Computer Programs(《计算机程序的构造和解释》)——大量使用递归过程/递归函数讲解抽象与求值。
  • The Art of Computer Programming(《计算机程序设计艺术》)——讨论递归思想在算法与数学结构中的应用。
  • Introduction to Algorithms(《算法导论》)——在分治、递归式与递归算法分析中频繁出现该概念。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2203 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 12:44 · PVG 20:44 · LAX 04:44 · JFK 07:44
♥ Do have faith in what you're doing.